package cn.xz.chess.activity;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;

public class PromotionActivity extends ListActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setResult(3);
        setListAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, mStrings));
        setTitle("PAWN_PROMOTION");
        getListView().setTextFilterEnabled(true);
        getListView().setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                                    long arg3) {
                PromotionActivity.this.setResult(arg2);
                PromotionActivity.this.finish();
            }

        });
    }

    private String[] mStrings = {"KNIGHT","BISHOP","ROOK","QUEEN"};
}
